using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class first_visit_informationMap : EntityTypeConfiguration<first_visit_information>
    {
        public first_visit_informationMap()
        {
            // Primary Key
            this.HasKey(t => new { t.name, t.id_card, t.node_name, t.is_need_transfer });

            // Properties
            this.Property(t => t.new_id)
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.name)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.gender)
                .HasMaxLength(50);

            this.Property(t => t.card_type)
                .HasMaxLength(50);

            this.Property(t => t.id_card)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.address)
                .HasMaxLength(100);

            this.Property(t => t.postcode)
                .HasMaxLength(6);

            this.Property(t => t.phone)
                .HasMaxLength(20);

            this.Property(t => t.is_transferred)
                .HasMaxLength(1);

            this.Property(t => t.transferred_from)
                .HasMaxLength(100);

            this.Property(t => t.para_name_3)
                .HasMaxLength(50);

            this.Property(t => t.para_name_4)
                .HasMaxLength(50);

            this.Property(t => t.para_name_5)
                .HasMaxLength(50);

            this.Property(t => t.occupation)
                .HasMaxLength(50);

            this.Property(t => t.cell_phone)
                .HasMaxLength(20);

            this.Property(t => t.email)
                .HasMaxLength(50);

            this.Property(t => t.para_name_6)
                .HasMaxLength(50);

            this.Property(t => t.para_name_7)
                .HasMaxLength(50);

            this.Property(t => t.know_ht_before)
                .HasMaxLength(1);

            this.Property(t => t.para_name_8)
                .HasMaxLength(50);

            this.Property(t => t.is_check_agree)
                .HasMaxLength(1);

            this.Property(t => t.para_name_9)
                .HasMaxLength(50);

            this.Property(t => t.diagnosed_hospital)
                .HasMaxLength(100);

            this.Property(t => t.family_history_hypertension)
                .HasMaxLength(1);

            this.Property(t => t.family_history_hypertension_age)
                .HasMaxLength(1);

            this.Property(t => t.family_history_chf)
                .HasMaxLength(1);

            this.Property(t => t.family_history_stroke)
                .HasMaxLength(1);

            this.Property(t => t.family_history_diabetes)
                .HasMaxLength(1);

            this.Property(t => t.family_history_none_of_above)
                .HasMaxLength(1);

            this.Property(t => t.family_history_unknown)
                .HasMaxLength(1);

            this.Property(t => t.family_history_not_answer)
                .HasMaxLength(1);

            this.Property(t => t.family_history_other)
                .HasMaxLength(1);

            this.Property(t => t.family_history_other_detail)
                .HasMaxLength(100);

            this.Property(t => t.bp_class_name)
                .HasMaxLength(50);

            this.Property(t => t.bp_level_name)
                .HasMaxLength(50);

            this.Property(t => t.bp_group_name)
                .HasMaxLength(50);

            this.Property(t => t.main_diagose_hospital)
                .HasMaxLength(200);

            this.Property(t => t.reason_not_goto_ch_medical)
                .HasMaxLength(1);

            this.Property(t => t.reason_not_goto_ch_finance)
                .HasMaxLength(1);

            this.Property(t => t.reason_not_goto_ch_hospital)
                .HasMaxLength(1);

            this.Property(t => t.reason_not_goto_ch_other)
                .HasMaxLength(1);

            this.Property(t => t.reason_not_goto_ch_other_desc)
                .HasMaxLength(50);

            this.Property(t => t.disease_chf)
                .HasMaxLength(1);

            this.Property(t => t.disease_stoke)
                .HasMaxLength(1);

            this.Property(t => t.disease_diabetes)
                .HasMaxLength(1);

            this.Property(t => t.disease_none_of_above)
                .HasMaxLength(1);

            this.Property(t => t.disease_unknown)
                .HasMaxLength(1);

            this.Property(t => t.disease_not_answer)
                .HasMaxLength(1);

            this.Property(t => t.disease_other)
                .HasMaxLength(1);

            this.Property(t => t.disease_other_detail)
                .HasMaxLength(100);

            this.Property(t => t.node_name)
                .IsRequired()
                .HasMaxLength(64);

            this.Property(t => t.alternate_contact)
                .HasMaxLength(50);

            this.Property(t => t.alternate_contact_desc)
                .HasMaxLength(100);

            this.Property(t => t.hospital_grade)
                .HasMaxLength(50);

            this.Property(t => t.follow_up_type)
                .HasMaxLength(20);

            this.Property(t => t.smoke_status)
                .HasMaxLength(50);

            this.Property(t => t.is_bmi_normal)
                .HasMaxLength(1);

            this.Property(t => t.uric_protein)
                .HasMaxLength(50);

            this.Property(t => t.cardiogram_link)
                .HasMaxLength(100);

            this.Property(t => t.is_bp_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_belly_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_hdl_c_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_ldl_c_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_tg_3_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_total_cholesterin_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_smoke_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_drug_complaince)
                .HasMaxLength(1);

            this.Property(t => t.is_transfer)
                .HasMaxLength(1);

            this.Property(t => t.drug_compliance)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_forget)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_stop)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_decrease)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_increase)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_change)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_frequency)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_dosage)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_other)
                .HasMaxLength(1);

            this.Property(t => t.drug_uncompliance_other_desc)
                .HasMaxLength(100);

            this.Property(t => t.is_need_transfer)
                .IsRequired()
                .HasMaxLength(15);

            this.Property(t => t.need_transfer_reason_1)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_2)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_3)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_4)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_5)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_6)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_other)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_other_desc)
                .HasMaxLength(100);

            this.Property(t => t.can_not_transfer_1)
                .HasMaxLength(1);

            this.Property(t => t.can_not_transfer_2)
                .HasMaxLength(1);

            this.Property(t => t.can_not_transfer_3)
                .HasMaxLength(1);

            this.Property(t => t.can_not_transfer_other)
                .HasMaxLength(1);

            this.Property(t => t.can_not_transfer_other_desc)
                .HasMaxLength(100);

            this.Property(t => t.chd_risk)
                .HasMaxLength(50);

            this.Property(t => t.framingham_score_group)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("first_visit_information");
            this.Property(t => t.new_id).HasColumnName("new_id");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.gender).HasColumnName("gender");
            this.Property(t => t.card_type).HasColumnName("card_type");
            this.Property(t => t.id_card).HasColumnName("id_card");
            this.Property(t => t.birth_date).HasColumnName("birth_date");
            this.Property(t => t.address).HasColumnName("address");
            this.Property(t => t.postcode).HasColumnName("postcode");
            this.Property(t => t.phone).HasColumnName("phone");
            this.Property(t => t.is_transferred).HasColumnName("is_transferred");
            this.Property(t => t.transferred_from).HasColumnName("transferred_from");
            this.Property(t => t.para_name_3).HasColumnName("para_name_3");
            this.Property(t => t.para_name_4).HasColumnName("para_name_4");
            this.Property(t => t.para_name_5).HasColumnName("para_name_5");
            this.Property(t => t.occupation).HasColumnName("occupation");
            this.Property(t => t.cell_phone).HasColumnName("cell_phone");
            this.Property(t => t.email).HasColumnName("email");
            this.Property(t => t.para_name_6).HasColumnName("para_name_6");
            this.Property(t => t.para_name_7).HasColumnName("para_name_7");
            this.Property(t => t.know_ht_before).HasColumnName("know_ht_before");
            this.Property(t => t.para_name_8).HasColumnName("para_name_8");
            this.Property(t => t.is_check_agree).HasColumnName("is_check_agree");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.para_name_9).HasColumnName("para_name_9");
            this.Property(t => t.diagnosed_sbp).HasColumnName("diagnosed_sbp");
            this.Property(t => t.diagnosed_dbp).HasColumnName("diagnosed_dbp");
            this.Property(t => t.diagnosed_hospital).HasColumnName("diagnosed_hospital");
            this.Property(t => t.diagnosed_date).HasColumnName("diagnosed_date");
            this.Property(t => t.family_history_hypertension).HasColumnName("family_history_hypertension");
            this.Property(t => t.family_history_hypertension_age).HasColumnName("family_history_hypertension_age");
            this.Property(t => t.family_history_chf).HasColumnName("family_history_chf");
            this.Property(t => t.family_history_stroke).HasColumnName("family_history_stroke");
            this.Property(t => t.family_history_diabetes).HasColumnName("family_history_diabetes");
            this.Property(t => t.family_history_none_of_above).HasColumnName("family_history_none_of_above");
            this.Property(t => t.family_history_unknown).HasColumnName("family_history_unknown");
            this.Property(t => t.family_history_not_answer).HasColumnName("family_history_not_answer");
            this.Property(t => t.family_history_other).HasColumnName("family_history_other");
            this.Property(t => t.family_history_other_detail).HasColumnName("family_history_other_detail");
            this.Property(t => t.bp_class_name).HasColumnName("bp_class_name");
            this.Property(t => t.bp_level_name).HasColumnName("bp_level_name");
            this.Property(t => t.bp_group_name).HasColumnName("bp_group_name");
            this.Property(t => t.main_diagose_hospital).HasColumnName("main_diagose_hospital");
            this.Property(t => t.times_goto_community_hospital).HasColumnName("times_goto_community_hospital");
            this.Property(t => t.times_goto_hospital).HasColumnName("times_goto_hospital");
            this.Property(t => t.reason_not_goto_ch_medical).HasColumnName("reason_not_goto_ch_medical");
            this.Property(t => t.reason_not_goto_ch_finance).HasColumnName("reason_not_goto_ch_finance");
            this.Property(t => t.reason_not_goto_ch_hospital).HasColumnName("reason_not_goto_ch_hospital");
            this.Property(t => t.reason_not_goto_ch_other).HasColumnName("reason_not_goto_ch_other");
            this.Property(t => t.reason_not_goto_ch_other_desc).HasColumnName("reason_not_goto_ch_other_desc");
            this.Property(t => t.disease_chf).HasColumnName("disease_chf");
            this.Property(t => t.disease_stoke).HasColumnName("disease_stoke");
            this.Property(t => t.disease_diabetes).HasColumnName("disease_diabetes");
            this.Property(t => t.disease_none_of_above).HasColumnName("disease_none_of_above");
            this.Property(t => t.disease_unknown).HasColumnName("disease_unknown");
            this.Property(t => t.disease_not_answer).HasColumnName("disease_not_answer");
            this.Property(t => t.disease_other).HasColumnName("disease_other");
            this.Property(t => t.disease_other_detail).HasColumnName("disease_other_detail");
            this.Property(t => t.node_name).HasColumnName("node_name");
            this.Property(t => t.alternate_contact).HasColumnName("alternate_contact");
            this.Property(t => t.alternate_contact_desc).HasColumnName("alternate_contact_desc");
            this.Property(t => t.hospital_grade).HasColumnName("hospital_grade");
            this.Property(t => t.follow_up_date).HasColumnName("follow_up_date");
            this.Property(t => t.height).HasColumnName("height");
            this.Property(t => t.weight).HasColumnName("weight");
            this.Property(t => t.heart_ratio).HasColumnName("heart_ratio");
            this.Property(t => t.blood_sugar).HasColumnName("blood_sugar");
            this.Property(t => t.blood_tg_3).HasColumnName("blood_tg_3");
            this.Property(t => t.blood_rbc).HasColumnName("blood_rbc");
            this.Property(t => t.blood_hb).HasColumnName("blood_hb");
            this.Property(t => t.blood_wbc).HasColumnName("blood_wbc");
            this.Property(t => t.blood_plt).HasColumnName("blood_plt");
            this.Property(t => t.uric_acid).HasColumnName("uric_acid");
            this.Property(t => t.follow_up_type).HasColumnName("follow_up_type");
            this.Property(t => t.smoke_status).HasColumnName("smoke_status");
            this.Property(t => t.smoke_number).HasColumnName("smoke_number");
            this.Property(t => t.bmi).HasColumnName("bmi");
            this.Property(t => t.is_bmi_normal).HasColumnName("is_bmi_normal");
            this.Property(t => t.belly_perimeter).HasColumnName("belly_perimeter");
            this.Property(t => t.sbp_final).HasColumnName("sbp_final");
            this.Property(t => t.dbp_final).HasColumnName("dbp_final");
            this.Property(t => t.sbp_1).HasColumnName("sbp_1");
            this.Property(t => t.dbp_1).HasColumnName("dbp_1");
            this.Property(t => t.sbp_2).HasColumnName("sbp_2");
            this.Property(t => t.dbp_2).HasColumnName("dbp_2");
            this.Property(t => t.sbp_3).HasColumnName("sbp_3");
            this.Property(t => t.dbp_3).HasColumnName("dbp_3");
            this.Property(t => t.blood_k).HasColumnName("blood_k");
            this.Property(t => t.kidney_cr).HasColumnName("kidney_cr");
            this.Property(t => t.kidney_bun).HasColumnName("kidney_bun");
            this.Property(t => t.uric_protein).HasColumnName("uric_protein");
            this.Property(t => t.uric_rc).HasColumnName("uric_rc");
            this.Property(t => t.uric_wc).HasColumnName("uric_wc");
            this.Property(t => t.hdl_c).HasColumnName("hdl_c");
            this.Property(t => t.ldl_c).HasColumnName("ldl_c");
            this.Property(t => t.total_cholesterin).HasColumnName("total_cholesterin");
            this.Property(t => t.cardiogram_link).HasColumnName("cardiogram_link");
            this.Property(t => t.is_bp_aim).HasColumnName("is_bp_aim");
            this.Property(t => t.is_belly_aim).HasColumnName("is_belly_aim");
            this.Property(t => t.is_hdl_c_aim).HasColumnName("is_hdl_c_aim");
            this.Property(t => t.is_ldl_c_aim).HasColumnName("is_ldl_c_aim");
            this.Property(t => t.is_tg_3_aim).HasColumnName("is_tg_3_aim");
            this.Property(t => t.is_total_cholesterin_aim).HasColumnName("is_total_cholesterin_aim");
            this.Property(t => t.is_smoke_aim).HasColumnName("is_smoke_aim");
            this.Property(t => t.is_drug_complaince).HasColumnName("is_drug_complaince");
            this.Property(t => t.is_transfer).HasColumnName("is_transfer");
            this.Property(t => t.drug_compliance).HasColumnName("drug_compliance");
            this.Property(t => t.drug_uncompliance_forget).HasColumnName("drug_uncompliance_forget");
            this.Property(t => t.drug_uncompliance_stop).HasColumnName("drug_uncompliance_stop");
            this.Property(t => t.drug_uncompliance_decrease).HasColumnName("drug_uncompliance_decrease");
            this.Property(t => t.drug_uncompliance_increase).HasColumnName("drug_uncompliance_increase");
            this.Property(t => t.drug_uncompliance_change).HasColumnName("drug_uncompliance_change");
            this.Property(t => t.drug_uncompliance_frequency).HasColumnName("drug_uncompliance_frequency");
            this.Property(t => t.drug_uncompliance_dosage).HasColumnName("drug_uncompliance_dosage");
            this.Property(t => t.drug_uncompliance_other).HasColumnName("drug_uncompliance_other");
            this.Property(t => t.drug_uncompliance_other_desc).HasColumnName("drug_uncompliance_other_desc");
            this.Property(t => t.is_need_transfer).HasColumnName("is_need_transfer");
            this.Property(t => t.need_transfer_reason_1).HasColumnName("need_transfer_reason_1");
            this.Property(t => t.need_transfer_reason_2).HasColumnName("need_transfer_reason_2");
            this.Property(t => t.need_transfer_reason_3).HasColumnName("need_transfer_reason_3");
            this.Property(t => t.need_transfer_reason_4).HasColumnName("need_transfer_reason_4");
            this.Property(t => t.need_transfer_reason_5).HasColumnName("need_transfer_reason_5");
            this.Property(t => t.need_transfer_reason_6).HasColumnName("need_transfer_reason_6");
            this.Property(t => t.need_transfer_reason_other).HasColumnName("need_transfer_reason_other");
            this.Property(t => t.need_transfer_reason_other_desc).HasColumnName("need_transfer_reason_other_desc");
            this.Property(t => t.can_not_transfer_1).HasColumnName("can_not_transfer_1");
            this.Property(t => t.can_not_transfer_2).HasColumnName("can_not_transfer_2");
            this.Property(t => t.can_not_transfer_3).HasColumnName("can_not_transfer_3");
            this.Property(t => t.can_not_transfer_other).HasColumnName("can_not_transfer_other");
            this.Property(t => t.can_not_transfer_other_desc).HasColumnName("can_not_transfer_other_desc");
            this.Property(t => t.chd_risk).HasColumnName("chd_risk");
            this.Property(t => t.framingham_score_group).HasColumnName("framingham_score_group");
        }
    }
}
